# CROSS_COMPILE = mips-openwrt-linux-musl-
# cc = $(CROSS_COMPILE)gcc
cc = gcc
target = camera_h264
deps = $(shell find ./ -name "*.h")
src  = $(shell find ./ -name "*.c")
obj  = $(src:%.c=%.o)
ROOT_DIR = .
INCLUDES :=
INCLUDES += -I$(ROOT_DIR)/inc
INCLUDES += -I$(ROOT_DIR)/lib
CFLAGS += -pipe -Wall -O2 $(INCLUDES)
LIBS = -lpthread -lx264 -lm

$(target): $(obj)

	$(cc) -g -o $(target) $(obj) $(LIBS)
	rm -rf $(obj)

%.o: %.c $(deps) 
	$(cc) $(CFLAGS) -c $< -o $@

clean:
	rm -rf $(obj) $(target)
